/*
* $Id: STreeDrawer.h 133 2010-08-16 16:33:49Z volok-aleksej@yandex.ru $
*
* Copyright 2010 by Volokitin Alexey
* All rights reserved
*
*/
#ifndef _STREE_DRAWER_H_
#define _STREE_DRAWER_H_

#include "../Drawer.h"
#include "STreeItem.h"

class CSTreeDrawer : public CDrawer
{
	int m_yPos;
	std::vector<CSTreeItem*> m_aItems;
	CSTreeItem* m_pSelectedItem;
public:
	CSTreeDrawer(IWnd* pParent);
	virtual ~CSTreeDrawer();
public:
	void InsertItem(int nId, const std::tstring& strName);
	void InsertParentItem(int nId, const std::tstring& strName);
	void AddChildItem(int nId, const std::tstring& strName);
public:
	void Clear();
	int CalcView(CRect rect);
	void SetPos(int yPos);
	void SelectItem(CSTreeItem* pSelectedItem);
	CSTreeItem* GetSelItem();
public:
	bool ProcessMouse(unsigned int nButton, CPoint pos, int param);
public:
	virtual bool IsValidDrawer(Drawer::typeDrawer nType);
	virtual void Paint(CDC* dc, CRect rect);
};

#endif/*_STREE_DRAWER_H_*/